<a:outputPanel xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j" ajaxRendered="true" >

	<h:form>
		<rich:modalPanel domElementAttachment="form" showWhenRendered="true" autosized="true" moveable="true" height="480" width="640">
	 		<f:facet name="header"></f:facet>
	 			<rich:simpleTogglePanel id="sp" switchType="client" reRender="sp" opened="true" >
	    			<f:facet name="header">
			        	<h:outputText value="#{messages.search_msg}" />
		            </f:facet>
		    		<a:commandButton id="search_" value="#{messages.search_msg}" 
		    			action="#{kDiscountManager.search()}" reRender="item_table" >
		    			<s:defaultAction />
		    		</a:commandButton>
	    			<table>
	    				<tr>
	    					<td>
	    						<h:outputLabel for="price_from" value="#{messages.price_from_msg}" />&#160;<br />
	    						<h:inputText id="price_from" value="#{kDiscountManager.search.priceFrom}" size="4"/>    						
	    					</td>
	    					<td>
	    						<h:outputLabel for="price_to" value="#{messages.price_to_msg}" />&#160;<br />
	    						<h:inputText id="price_to" value="#{kDiscountManager.search.priceTo}" size="4"/>    						
	    					</td>
	    					<td>
	    						<h:outputLabel for="created" value="#{messages.valid_to_msg}" />&#160;<br />
	    						<rich:calendar id="created" value="#{kDiscountManager.search.validTo}" cellWidth="30px" cellHeight="30px" showWeeksBar="false" />    						
	    					</td>
	    				</tr>
	    			</table>
	    		</rich:simpleTogglePanel>
	    		<br />
				<rich:dataTable id="item_table" value="#{kDiscountManager.itemList}" var="e" rows="5" >
					<rich:column>
						<f:facet name="header">
							<h:outputText value="#{messages.mark_msg}" />
						</f:facet>
						<h:selectBooleanCheckbox value="#{e.marked}" />
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="#{messages.img_msg}" />
						</f:facet>
						<a href="/#{kInitParam.imgPath}/i_#{e.img.itemId}/#{e.img.name}" target="blank_">
							<img src="/#{kInitParam.imgPath}/i_#{e.img.itemId}/#{e.img.thumb}" width="50px" height="50px"/>
						</a>
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="#{messages.kadrons_msg}" />
						</f:facet>
						<h:outputText value="#{e.item.kadrons}" />
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="#{messages.name_msg}" />
						</f:facet>
						<h:outputText value="#{e.item.getName(kUser.klang)}" />
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="#{messages.application_msg}" />
						</f:facet>
						<h:outputText value="#{e.item.application.getName(kUser.klang)}" />
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="#{messages.item_type_msg}" />
						</f:facet>
						<h:outputText value="#{e.item.itemType.getName(kUser.klang)}" />
					</rich:column>
					<f:facet name="footer">
						<rich:datascroller renderIfSinglePage="false"/>
					</f:facet>
				</rich:dataTable>
				<br />
				<a:commandButton action="#{kDiscountManager.closeItemPopup()}" value="#{messages.close_msg}" immediate="true" reRender="#{reRenderIDS}"/>
				&#160;
				<a:commandButton action="#{kDiscountManager.addItems()}" value="#{messages.add_items_msg}" reRender="item_table" limitToList="true"/>
		</rich:modalPanel>
	</h:form>
</a:outputPanel>